package gui.partb;

import java.io.Serializable;

/**
 * 
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class Teacher extends Person implements Serializable {
    /**
     * 属性描述：教师id
     */
    private String teacherId;

    /**
     * 属性描述：登录名称
     */
    private String loginName;

    /**
     * 属性描述：登录密码
     */
    private String password;

    public Teacher(String name, String gender, String teacherId, String loginName, String password) {
        super(name, gender);
        this.teacherId = teacherId;
        this.loginName = loginName;
        this.password = password;
    }

    public String getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        // 密码解密
        String decrypt = null;
        try {
            decrypt = Encryption.decrypt(password);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return teacherId + " " + loginName + " " + decrypt + " " + super.getName() + " " + super.getGender();
    }
}
